class Solution1 {
    public int firstUniqChar(String s) {
        int[] ch = new int[26];
        for(int i = 0; i < s.length(); i++){
            char x = s.charAt(i);
            ch[x - 'a']++;
        }
        for(int i = 0; i < s.length(); i++){
            char x = s.charAt(i);
            if(ch[x - 'a'] == 1){
                return i;
            }
        }
        return -1;
    }
}

class Solution {
    private boolean isLegal(char ch) {
        if(ch >= 'a' && ch <= 'z'  || ch >= '0' && ch <= '9') {
            return true;
        }
        return false;
    }
    public boolean isPalindrome(String s) {
        s = s.toLowerCase();
        int left = 0;
        int right = s.length() - 1;
        while(left < right){
            while(left<right&&!isLegal(s.charAt(left))){
                left++;
            }
            while(left<right&&!isLegal(s.charAt(right))){
                right--;
            }
            if(s.charAt(left) == s.charAt(right)){
                left++;
                right--;
            }else{
                return false;
            }
        }
        return true;
    }
}
public class Test {

}
 class TestClass {

    private static void testMethod(){

        System.out.println("testMethod");

    }

    public static void main(String[] args) {

        ((TestClass)null).testMethod();

    }

}